﻿using AuthorityManagement.Model;
using AutoMapper;
using static AuthorityManagement.Controllers.MenuController;

namespace AuthorityManagement.AutoMapper
{
    public class MenuMapper : Profile
    {
        public MenuMapper()
        {
            CreateMap<MenuSelectDto, Menu>()
              .ForMember(d => d.MenuName, dst => dst.MapFrom(s => s.Name))
          .ForMember(d => d.MenuName, dst => dst.MapFrom(s => s.Name));

            CreateMap<Menu, MenuSelectDto>()
              .ForMember(d => d.Name, dst => dst.MapFrom(s => s.MenuName))
          .ForMember(d => d.Name, dst => dst.MapFrom(s => s.MenuName));
        }

    }
}
